# 使用xpath找到白嫖者联盟网页的title

# 使用requests库获取网页
import requests
from lxml import etree

url = 'https://www.bpzhe.com/'
rq = requests.get(url)
# 返回网页的html字符串文本
resultHtml = rq.content.decode('utf-8')
print(resultHtml)

# 字符串转换为html网页
html = etree.HTML(resultHtml)
# 通过名称定为title节点的文本内容
title = html.xpath('head/title/text()')
print("获取到网页的title标签内容: ", title)


